import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Bala here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Bala extends Actor
{
    private int danio;
    private int velocidad;
    private int dir;
    /**
     * Act - do whatever the Bala wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public Bala(int d,int v,int di){
     danio=d;
     velocidad=v;
     dir=di;
    }
    public void act() 
    {
        Mundo aux=(Mundo)getWorld();
        Cartman c=aux.getCartman();
        if(dir==1)
        setLocation(getX()+velocidad,getY());
        if(dir==2)
        setLocation(getX()-velocidad,getY());
    }   
    
    public int getDanio(){
        return danio;
    }
}
